#include <stdio.h>  
int main()  
{    
    int i, j, number;  
    j = 0;  
    for (number = 2; number <= 1000; number++)   
    {  
        for(i = 2; i <= number-1; i++)  
        {  
            if(number % i == 0) 
            break;   
        }   
        if (i >= number)  
        {  
            printf ("%d\t", number);
            j = j + 1;  
            if ( j % 5 == 0)
            printf ("\n");  
        }  
    }   
    printf ("\n");  
    return 0;  
}  
